<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<ui:composition template="../../templates/template.xhtml">

	<ui:define name="title">
	 	Import Confirmation Page
	</ui:define>
	<ui:param name="page" value="home" />
	<ui:define name="header">
		<ui:include src="../../header.xhtml" />
 
	</ui:define>

	 <ui:define name="menu">
	 	<div align="center">
	 		<h:form id="menuForm">
	 			<br />
	 			<br />
				<h:commandButton id="Import"
		  				value="#{clerkImportConfirmationPage.importButtonText}" 
		  				action="#{clerkImportConfirmationPage.importCaseRecord}" rendered="#{not (clerkImportConfirmationPage.signatureFailureMessage)}"
		 				styleClass="buttonClass"  />
	 			<br />
	 			<br />
	 			<h:commandButton 
	 					value="Back" 
	 					action="gotoCaseDetailsPage" rendered="#{not (clerkImportConfirmationPage.signatureFailureMessage)}"
	 					styleClass="buttonClass"/>
	 			<br/>
	 			<br/>
	  			<h:commandButton 
	  					value="Reject this filing" action="#{clerkImportConfirmationPage.gotoRejectFilingFromImportPrecess}" 
	  					rendered="#{(clerkImportConfirmationPage.signatureFailureMessage) || (clerkImportConfirmationPage.noContentsDocumentMessage) 
	  								|| (clerkImportConfirmationPage.noCourtReceivedStampMessage)}"
	  					immediate="true"
	  					styleClass="buttonClass"/>
	  		</h:form>
		 </div>
	</ui:define> 
	
	<ui:define name="body">
	
			<h:form id="noContentsDocumentForm" >
				<h:panelGroup>
					<h:dataTable width="100%" value="#{clerkImportConfirmationPage.documentListWithoutContents}" var="docWithoutContents" 
							columnClasses="dataTableColumnClass,dataTableColumnClass" >
						<h:column>
								<f:facet name="header">
									<h:outputText 
											value="The following document(s) " 
											rendered="#{clerkImportConfirmationPage.noContentsDocumentMessage}"
											styleClass="header" />
								</f:facet>
								<h:panelGroup>
										<h:outputText value="#{docWithoutContents.title}"
											styleClass="header" />										
								</h:panelGroup>						
						</h:column>
					</h:dataTable>
					<h:outputText 
											value="caused a system Error: Please Check Documents: Case Management System not Responding 
													Please do not try to Reject, reimport or Import another case
														Contact Your Administrator" 
											rendered="#{clerkImportConfirmationPage.noContentsDocumentMessage}"
											styleClass="header" />
				</h:panelGroup>					
			</h:form>
			
			<h:form  id="noClerkSignatureForm">
				<h:panelGroup>
					<h:dataTable width="100%" value="#{clerkImportConfirmationPage.documentListNotSignedByClerk}" var="docWithoutClerkSignature" 
							columnClasses="dataTableColumnClass,dataTableColumnClass" >
						<h:column>
								<f:facet name="header">
									<h:outputText 
											value="The following document(s) " 
											rendered="#{clerkImportConfirmationPage.signatureFailureMessage}"
											styleClass="header" />
								</f:facet>
								<h:panelGroup>
										<h:outputText value="#{docWithoutClerkSignature.title}"
											styleClass="header" />										
								</h:panelGroup>						
						</h:column>
					</h:dataTable>
					<h:outputText 
											value="caused a system Error: System recorded the following : Filing 
													Not Accepted By Court due to Clerk signature failure.
														Please reject Filing or try to sign the document(s) again" 
											rendered="#{clerkImportConfirmationPage.signatureFailureMessage}"
											styleClass="header" />
				</h:panelGroup>					
			</h:form>
			
			
			<h:form  id="noCourtReceivedStampForm">
				<h:panelGroup>
					<h:dataTable width="100%" value="#{clerkImportConfirmationPage.documentListWithoutCourtReceivedStamp}" var="docWithoutCourtReceivedStamp" 
							columnClasses="dataTableColumnClass,dataTableColumnClass" >
						<h:column>
								<f:facet name="header">
									<h:outputText 
											value="The following document(s) " 
											rendered="#{clerkImportConfirmationPage.noCourtReceivedStampMessage}"
											styleClass="header" />
								</f:facet>
								<h:panelGroup>
										<h:outputText value="#{docWithoutCourtReceivedStamp.title}"
											styleClass="header" />										
								</h:panelGroup>						
						</h:column>
					</h:dataTable>
					<h:outputText 
											value="caused a system Error: System recorded the following : Filing 
													Not Accepted By Court due to Technical Error. 
														Please reject Filing or try to Import again" 
											rendered="#{clerkImportConfirmationPage.noCourtReceivedStampMessage}"
											styleClass="header" />
				</h:panelGroup>					
			</h:form>
			
		
		
		
		
		
		
		
		<h:form>	
		<t:saveState id="caseDetailsPage" value="#{clerkCaseDetailsPage}" />
			<div class="allPeopleHolder">
			<h:panelGrid columns="2" styleClass="tablehead">
				<h:outputLabel value="Filer Name:" />
				<h:outputLabel	value="#{clerkCaseDetailsPage.filerName}" />
				<h:outputLabel value="Division:" />
				<h:outputText value="#{clerkCaseDetailsPage.caseRecord.localCaseDivision.description}" />
				<h:outputLabel value="Case Category:" />
				<h:outputText value="#{clerkCaseDetailsPage.caseRecord.localCaseCategory.description}" /> 
			</h:panelGrid> 
			<h:panelGrid columns="2" styleClass="tablehead">				
				<h:outputLabel value="Case Filing Type:" />
				<h:outputText value="#{clerkCaseDetailsPage.caseRecord.localCaseFilingType.description}" />
				<h:outputLabel value="Case Type: " />
				<h:outputText value="#{clerkCaseDetailsPage.caseRecord.localCaseType.description}" />
				<h:outputLabel value="Case Caption: " />
				<h:outputLabel value="#{clerkCaseDetailsPage.caseCaption}" />
				<h:outputText value="OCSS Case Number: " />
				<h:outputText value="#{clerkCaseDetailsPage.OCSSCaseNumber}" />
				<h:outputText value="Court Case Number: " />
				<h:outputText value="#{clerkCaseDetailsPage.courtCaseNumber}" />
				<h:outputLabel value="Court Date: " />
				<h:outputText value="#{clerkCaseDetailsPage.courtDate}" />
				<h:outputText value="Jurisdiction: " />
				<h:outputText value="#{clerkCaseDetailsPage.jurisdiction}" />
			</h:panelGrid>
			</div> 
			<br />
			<!-- *************************Case Participants*****************************-->
 			<h:outputText value="CASE PARTICIPANTS" styleClass="header" />
 			
 			
 			<!-- ****************************Initiating Party Organization******************-->
 				<div class="grouping">
			<h:outputText value="Initiating Party Organization" styleClass="subHeadingClass" />
	<!-- <h:dataTable width="100%" value="#{sessionScope.clerkCaseDetailsPage.initiatingPartyOrganizationDataModel}" var="initiatingPartyOrganization" columnClasses="dataTableColumnClass,dataTableColumnClass" > -->
			<h:panelGroup>
			
				<h:dataTable width="100%" value="#{clerkCaseDetailsPage.initiatingPartyOrganizationDataModel}" var="initiatingPartyOrganization" columnClasses="dataTableColumnClass,dataTableColumnClass" >
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{initiatingPartyOrganization.organizations.name}"
								styleClass="textFont75" />								
							
						</h:panelGroup>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Address" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:dataTable value="#{initiatingPartyOrganization.organizations.addresses}"
							var="addresses">
							<h:column>
								<h:panelGroup>
									<h:outputText value="#{addresses.address.streetFullText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.streetExtensionText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.cityName}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.zipCode}"
										styleClass="textFont75" />
								</h:panelGroup>
							</h:column>
						</h:dataTable>
					</h:column>
				</h:dataTable>
			</h:panelGroup> 
			</div>			 <!-- ******************************************************************-->
 			<div class="grouping">
			<h:outputText value="Initiating Party Person"
				styleClass="subHeadingClass" /> 
				<!-- <h:dataTable width="100%" value="#{sessionScope.clerkCaseDetailsPage.initiatingPartyPersonModel}" var="initiatingPartyPerson" columnClasses="dataTableColumnClass,dataTableColumnClass"> -->	
			
				<h:panelGroup>
					<h:dataTable width="100%" value="#{clerkCaseDetailsPage.initiatingPartyPersonModel}" var="initiatingPartyPerson" columnClasses="dataTableColumnClass,dataTableColumnClass">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{initiatingPartyPerson.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{initiatingPartyPerson.person.middleName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{initiatingPartyPerson.person.lastName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{initiatingPartyPerson.person.suffixName}"
								styleClass="textFont75" />
						</h:panelGroup>
					</h:column>
				</h:dataTable>
			</h:panelGroup> 
			</div>
			 <!-- ****************************Defendent Party Person******************-->
 				<div class="grouping">
			<h:outputText value="Defendent Party" styleClass="subHeadingClass" />

			<h:panelGroup>
				<!--<h:dataTable width="100%" value="#{sessionScope.clerkCaseDetailsPage.defendentPartyPersonModel}" var="defendentParty" columnClasses="dataTableColumnClass,dataTableColumnClass" >  -->
				<h:dataTable width="100%" value="#{clerkCaseDetailsPage.defendentPartyPersonModel}" var="defendentParty" columnClasses="dataTableColumnClass,dataTableColumnClass" >
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{defendentParty.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentParty.person.middleName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentParty.person.lastName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentParty.person.suffixName}"
								styleClass="textFont75" />
						</h:panelGroup>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Address" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:dataTable value="#{defendentParty.person.addresses}"
							var="addresses">
							<h:column>
								<h:panelGroup>
									<h:outputText value="#{addresses.address.streetFullText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.streetExtensionText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.cityName}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.zipCode}"
										styleClass="textFont75" />
								</h:panelGroup>
							</h:column>
						</h:dataTable>
					</h:column>
				</h:dataTable>
			</h:panelGroup> 
			</div>
			 <!-- *****************************Witness************************************* -->
			 <div class="grouping">
			<h:panelGroup>
				<h:outputText value="Witness" styleClass="subHeadingClass" />
			</h:panelGroup> <h:panelGroup>
				<h:dataTable id="DATATABLE_witness" width="100%"  value="#{clerkCaseDetailsPage.witnessPersonModel}" var="witness"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
				<!-- value="#{sessionScope.clerkCaseDetailsPage.witnessPersonModel}" var="witness" -->	
				
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{witness.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{witness.person.middleName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{witness.person.lastName}"
								styleClass="textFont75" />
							<h:outputText value="#{witness.person.suffixName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
						</h:panelGroup>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Address" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:dataTable value="#{witness.person.addresses}" var="addresses">
							<h:column>
								<h:panelGroup>
									<h:outputText value="#{addresses.address.streetFullText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.streetExtensionText}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.cityName}"
										styleClass="textFont75" />
									<h:outputText value=" " />
									<h:outputText value="#{addresses.address.zipCode}"
										styleClass="textFont75" />
								</h:panelGroup>
							</h:column>
						</h:dataTable>
					</h:column>
				</h:dataTable>
			</h:panelGroup> 
			</div>
			 <!-- ********************************Plaintiff's Attorney*************************** -->
 			<div class="grouping">
			<h:panelGroup>
				<h:outputText value="Plaintiff's Attorney"
					styleClass="subHeadingClass" escape="true" />
			</h:panelGroup> <h:panelGroup>
				<h:dataTable id="DATATABLE_plantiff" width="100%"  value="#{clerkCaseDetailsPage.plantiffsAttorneyModel}"
					var="plantiff" 
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<!--  value="#{sessionScope.clerkCaseDetailsPage.plantiffsAttorneyModel}" --> 
					 
					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{plantiff.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{plantiff.person.middleName}"
styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{plantiff.person.lastName}"
							styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{plantiff.person.suffixName}"
styleClass="textFont75" />
						</h:panelGroup>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="BarID" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:outputText value="#{plantiff.person.attorney.barID}"
							styleClass="textFont75" />
					</h:column>
				</h:dataTable>
			</h:panelGroup> 
			 </div>
			<!-- ********************************Defendent's Attorney*************************** -->
 <div class="grouping">
			<h:panelGroup>
				<h:outputText value="Defendent's Attorney"
					styleClass="subHeadingClass" escape="true" />
			</h:panelGroup> 
			<h:panelGroup>
				<h:dataTable id="DATATABLE_defendent" width="100%" value="#{clerkCaseDetailsPage.defendentsAttorneyModel}" 					var="defendentsAttorney"
					columnClasses="dataTableColumnClass,dataTableColumnClass">
					<!-- value="#{sessionScope.clerkCaseDetailsPage.defendentsAttorneyModel}" -->

					<h:column>
						<f:facet name="header">
							<h:outputText value="Name" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:panelGroup>
							<h:outputText value="#{defendentsAttorney.person.firstName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentsAttorney.person.middleName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentsAttorney.person.lastName}"
								styleClass="textFont75" />
							<h:outputText value=" " />
							<h:outputText value="#{defendentsAttorney.person.suffixName}"
								styleClass="textFont75" />
						</h:panelGroup>
					</h:column>
					<h:column>
						<f:facet name="header">
							<h:outputText value="BarID" styleClass="subHeadingTextClass" />
						</f:facet>
						<h:outputText value="#{defendentsAttorney.person.attorney.barID}"
							styleClass="textFont75" />
					</h:column>
				</h:dataTable>
			</h:panelGroup>
 
</div>
			<!-- *****************************Documents****************************-->
		<div class="grouping">
			<h:outputText value="DOCUMENTS" styleClass="header" />		 

			
				<h:panelGrid columns="2" width="100%">
					<h:dataTable id="DATATABLE_i_documents" width="100%" 
						value="#{clerkCaseDetailsPage.importedDocumentsModel}"
						var="documents_imported"
						columnClasses="dataTableSubColumnClass,dataTableSubColumnClass">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Title" styleClass="subHeadingTextClass" />
							</f:facet>
							<h:commandLink value="#{documents_imported.title}" action="#{clerkCaseDetailsPage.viewFile}" styleClass="textFont75">
             					<f:param name="title" value="#{documents_imported.title}"/>
             					<f:param name="physicalType" value="#{documents_imported.physicalType}" />
         					</h:commandLink>
					<!--  		<h:panelGroup>  
								<h:outputText value="#{documents_imported.title}" styleClass="textFont75" />							 
							</h:panelGroup> -->
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Type" styleClass="subHeadingTextClass" />
							</f:facet>
							<h:outputText value="#{documents_imported.documentInstance.description}" styleClass="textFont75" />
						</h:column>
						<!-- 
						<h:column >
							<f:facet name="header">
								<h:outputText value=""  />
							</f:facet>
							<h:outputText value="Sealed" styleClass="textFont75Bold" />  
						</h:column>
						 -->
						<!-- Frank added following block -->
						<!-- Frank commented out "and not(documents_imported.signedDoc)" -->	
						<h:column rendered="#{(documents_imported.orderedDoc) and not(documents_imported.signedDoc)}">
						<f:facet name="header">
								<h:outputText value="Sign Document" styleClass="subHeadingTextClass" />
						</f:facet>
							<h:commandLink  value="Sign" action="#{clerkCaseDetailsPage.signDocument}"  styleClass="textFont75Link"  >
							<!-- Frank changed signatureBinding to validateBinding -->
								<f:param name="doc" value="#{documents_imported}" binding="#{clerkCaseDetailsPage.validateBinding}"/>								
							</h:commandLink>
						</h:column>						
						<!-- Frank ended adding here -->			
					 	<!-- <h:column >
							<f:facet name="header">
								<h:outputText value=""  />
							</f:facet>							
							<h:commandLink value="Seal" action="#{clerkCaseDetailsPage.gotoValidateDocument}"  styleClass="textFont75Link" >
								<f:param name="doc" value="#{documents_imported}" binding="#{clerkCaseDetailsPage.validateBinding}" /> 							
							</h:commandLink>
						</h:column>
						</h:column> -->						
						<h:column rendered="#{ (documents_imported.signedDoc)}">
							<f:facet name="header">
								<h:outputText value=""  />
							</f:facet>
							<h:commandLink value="View Details" action="#{clerkCaseDetailsPage.viewSignatureDetails}"  styleClass="textFont75Link" >
								<f:param name="doc" value="#{documents_imported}" binding="#{clerkCaseDetailsPage.signatureBinding}" /> 							
							</h:commandLink>
						</h:column> 						
					</h:dataTable>				
				</h:panelGrid>
				
				<br />
				
				<h:outputText value="Uploaded Documents" styleClass="tablehead" />				
				<h:panelGrid columns="2" width="100%">
					<h:dataTable id="DATATABLE_n_documents" width="100%" 
						value="#{clerkCaseDetailsPage.uploadedDocumentsModel}"
						var="documents_uploaded"
						columnClasses="dataTableSubColumnClass,dataTableSubColumnClass">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Title" styleClass="subHeadingTextClass" />
							</f:facet>
							<h:commandLink value="#{documents_uploaded.title}" action="#{clerkCaseDetailsPage.viewFile}" styleClass="textFont75">
             					<f:param name="title" value="#{documents_uploaded.title}"/>
             					<f:param name="physicalType" value="#{documents_uploaded.physicalType}" />
         					</h:commandLink>
					<!--  		<h:panelGroup>  
								<h:outputText value="#{documents_uploaded.title}" styleClass="textFont75" />							 
							</h:panelGroup> -->
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Type" styleClass="subHeadingTextClass" />
							</f:facet>
							<h:outputText value="#{documents_uploaded.documentInstance.description}" styleClass="textFont75" />
						</h:column>
						<!-- 
						<h:column >
							<f:facet name="header">
								<h:outputText value=""  />
							</f:facet>
							<h:outputText value="Sealed" styleClass="textFont75Bold" />  
						</h:column>
						 -->
						<!-- Frank added following block -->
						<!-- Frank commented out "and not(documents_uploaded.signedDoc)" -->	
						<h:column rendered="#{(documents_uploaded.orderedDoc) and not(documents_uploaded.signedDoc)}">
						<f:facet name="header">
								<h:outputText value="Sign Document" styleClass="subHeadingTextClass" />
						</f:facet>
							<h:commandLink  value="Sign" action="#{clerkCaseDetailsPage.signDocument}"  styleClass="textFont75Link"  >
							<!-- Frank changed signatureBinding to validateBinding -->
								<f:param name="doc" value="#{documents_uploaded}" binding="#{clerkCaseDetailsPage.validateBinding}"/>								
							</h:commandLink>
						</h:column>						
						<!-- Frank ended adding here -->			
					 	<!-- <h:column >
							<f:facet name="header">
								<h:outputText value=""  />
							</f:facet>							
							<h:commandLink value="Seal" action="#{clerkCaseDetailsPage.gotoValidateDocument}"  styleClass="textFont75Link" >
								<f:param name="doc" value="#{documents_uploaded}" binding="#{clerkCaseDetailsPage.validateBinding}" /> 							
							</h:commandLink>
						</h:column>
						</h:column> -->						
						<h:column rendered="#{ (documents_uploaded.signedDoc)}">
							<f:facet name="header">
								<h:outputText value=""  />
							</f:facet>
							<h:commandLink value="View Details" action="#{clerkCaseDetailsPage.viewSignatureDetails}"  styleClass="textFont75Link" >
								<f:param name="doc" value="#{documents_uploaded}" binding="#{clerkCaseDetailsPage.signatureBinding}" /> 							
							</h:commandLink>
						</h:column> 						
					</h:dataTable>			
				</h:panelGrid>
				<br/>
				<br/>
		</div>
			
		</h:form>

	</ui:define>
</ui:composition>

</html>